/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.supplier.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.T025;
import queenb.net.entitybean.V350;
import queenb.web.supplier.interfaca.T025Inf;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class T025Store extends T025 implements T025Inf {

    @Override
    public List<T025> getListT025All(int pnPT025, int pnREFID, String pvTV026, int pnFH000, int pnFH200, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_T025, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT025),
                    new Param(OracleTypes.INTEGER, pnREFID),
                    new Param(OracleTypes.CHAR, pvTV026),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, T025.class);
        } catch (SQLException ex) {
            Logger.getLogger(T025Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(T025Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(T025Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    @Override
    public int updateT025(int pnPT025, int pnREFID, String pvTV026, String pvTV027, String pvTV028, String pvTV029, String pvTV030, int pnTN031, int pnTN032, int pnTN033, int pnFH000, int pnFH200, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_T025, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPT025),
                        new Param(OracleTypes.INTEGER, pnREFID),
                        new Param(OracleTypes.CHAR, pvTV026),
                        new Param(OracleTypes.CHAR, pvTV027),
                        new Param(OracleTypes.CHAR, pvTV028),
                        new Param(OracleTypes.CHAR, pvTV029),
                        new Param(OracleTypes.CHAR, pvTV030),
                        new Param(OracleTypes.INTEGER, pnTN031),
                        new Param(OracleTypes.INTEGER, pnTN032),
                        new Param(OracleTypes.INTEGER, pnTN033),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, T025.class);
        } catch (SQLException ex) {
            Logger.getLogger(T025Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    @Override
    public int deleteT025(int pnPT025, int pnREFID, String pvTV026, String pvLOGIN) {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_T025, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnPT025),
                    new Param(OracleTypes.INTEGER, pnREFID),
                    new Param(OracleTypes.CHAR, pvTV026),
                    new Param(OracleTypes.CHAR, pvLOGIN)});
        try {
            return super.update(dataStatement, T025.class);
        } catch (SQLException ex) {
            Logger.getLogger(T025Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }
}
